//
// Created by Administrator on 2021/5/26.
// @file cm_broadcast_test.c
// @author jmdvirus
// @date 2021-05-26 14:25:18
//

#include "cm_broadcast.h"
#include "utils/cm_logprint.h"

CMLogPrint logPrint;

int main()
{
    int               port = 12306;
    CMBroadcastHandle h;
    int               ret = cm_broadcast_init(&h, port);
    if (ret < 0)
    {
        printf("error init [%d]\n", ret);
        return -1;
    }
    cm_broadcast_set_info(h, "12345678", "128.123.123.123", "1.0.20");

    ret = cm_broadcast_start(h);
    if (ret < 0)
    {
        printf("start error [%d]\n", ret);
        return -2;
    }
    printf("start success\n");
    int count = 0;
    while (count++ < 50)
    {
        sleep(1);
    }

    cm_broadcast_close(&h);
    return 0;
}